using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Hydrology
{
    /// <summary>
    /// <para>Flow Distance</para>
    /// <para>Computes, for each cell, the horizontal or vertical component of downslope distance, following the flow paths, to cells on a stream into which they flow. In case of multiple flow paths, minimum, weighted mean, or maximum flow distance can be computed.</para>
    /// <para>计算每个像元的水平或垂直分量，沿着流道，到它们流入的流中的像元的下坡距离。在多条流路的情况下，可以计算最小、加权平均或最大流距离。</para>
    /// </summary>    
    [DisplayName("Flow Distance")]
    public class FlowDistance : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FlowDistance()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_stream_raster">
        /// <para>Input stream raster</para>
        /// <para>An input stream raster that represents a linear stream network.</para>
        /// <para>表示线性流网络的输入流栅格。</para>
        /// </param>
        /// <param name="_in_surface_raster">
        /// <para>Input surface raster</para>
        /// <para>The input raster representing a continuous surface.</para>
        /// <para>表示连续表面的输入栅格。</para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para>The output flow distance raster.</para>
        /// <para>输出流距栅格。</para>
        /// </param>
        public FlowDistance(object _in_stream_raster, object _in_surface_raster, object _out_raster)
        {
            this._in_stream_raster = _in_stream_raster;
            this._in_surface_raster = _in_surface_raster;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Flow Distance";

        public override string CallName => "sa.FlowDistance";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "parallelProcessingFactor", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_stream_raster, _in_surface_raster, _out_raster, _in_flow_direction_raster, _distance_type.GetGPValue(), _flow_direction_type.GetGPValue(), _statistics_type.GetGPValue()];

        /// <summary>
        /// <para>Input stream raster</para>
        /// <para>An input stream raster that represents a linear stream network.</para>
        /// <para>表示线性流网络的输入流栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input stream raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_stream_raster { get; set; }


        /// <summary>
        /// <para>Input surface raster</para>
        /// <para>The input raster representing a continuous surface.</para>
        /// <para>表示连续表面的输入栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input surface raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_surface_raster { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output flow distance raster.</para>
        /// <para>输出流距栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Input flow direction raster</para>
        /// <para><xdoc>
        ///   <para>The input raster that shows the direction of flow out of each cell.</para>
        ///   <para>When a flow direction raster is provided, the down slope direction(s) will be limited to those defined by the input flow directions.</para>
        ///   <para>The flow direction raster can be created using the Flow Direction tool.</para>
        ///   <para>The flow direction raster can be created using the D8, Multiple Flow Direction (MFD), or D-Infinity method. Use the Input flow direction type parameter to specify the method used when the flow direction raster was created.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>显示流出每个像元的方向的输入栅格。</para>
        ///   <para>提供流向栅格时，下坡方向将限制为输入流向定义的方向。</para>
        ///   <para>可以使用流向工具创建流向栅格。</para>
        ///   <para>可以使用 D8、多流向 （MFD） 或 D-Infinity 方法创建流向栅格。使用输入流向类型参数指定创建流向栅格时使用的方法。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input flow direction raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_flow_direction_raster { get; set; } = null;


        /// <summary>
        /// <para>Distance type</para>
        /// <para><xdoc>
        ///   <para>Determines if the vertical or horizontal component of flow distance is calculated.</para>
        ///   <bulletList>
        ///     <bullet_item>Vertical—The flow distance calculations represent the vertical component of flow distance, following the flow path, from each cell in the domain to cell(s) on the stream into which they flow. This is the default.</bullet_item><para/>
        ///     <bullet_item>Horizontal—The flow distance calculations represent the horizontal component of flow distance, following the flow path, from each cell in the domain to cell(s) on the stream into which they flow.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定是计算流距离的垂直分量还是水平分量。</para>
        ///   <bulletList>
        ///     <bullet_item>垂直 - 流距离计算表示流距离的垂直分量，沿着流路径，从域中的每个像元到它们流入的流中的像元。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>水平 - 流距离计算表示从属性域中的每个像元到流入的流中的像元的流动距离的水平分量，该流距离遵循流路径。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _distance_type_value _distance_type { get; set; } = _distance_type_value._VERTICAL;

        public enum _distance_type_value
        {
            /// <summary>
            /// <para>Vertical</para>
            /// <para>Vertical—The flow distance calculations represent the vertical component of flow distance, following the flow path, from each cell in the domain to cell(s) on the stream into which they flow. This is the default.</para>
            /// <para>垂直 - 流距离计算表示流距离的垂直分量，沿着流路径，从域中的每个像元到它们流入的流中的像元。这是默认设置。</para>
            /// </summary>
            [Description("Vertical")]
            [GPEnumValue("VERTICAL")]
            _VERTICAL,

            /// <summary>
            /// <para>Horizontal</para>
            /// <para>Horizontal—The flow distance calculations represent the horizontal component of flow distance, following the flow path, from each cell in the domain to cell(s) on the stream into which they flow.</para>
            /// <para>水平 - 流距离计算表示从属性域中的每个像元到流入的流中的像元的流动距离的水平分量，该流距离遵循流路径。</para>
            /// </summary>
            [Description("Horizontal")]
            [GPEnumValue("HORIZONTAL")]
            _HORIZONTAL,

        }

        /// <summary>
        /// <para>Input flow direction type</para>
        /// <para><xdoc>
        ///   <para>Specifies the input flow direction raster type.</para>
        ///   <bulletList>
        ///     <bullet_item>D8—The input flow direction raster is of type D8. This is the default.</bullet_item><para/>
        ///     <bullet_item>MFD—The input flow direction raster is of type Multi Flow Direction (MFD).</bullet_item><para/>
        ///     <bullet_item>DINF—The input flow direction raster is of type D-Infinity (DINF).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输入流向栅格类型。</para>
        ///   <bulletList>
        ///     <bullet_item>D8 - 输入流向栅格的类型为 D8。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>MFD—输入流向栅格的类型为多流向 （MFD）。</bullet_item><para/>
        ///     <bullet_item>DINF—输入流向栅格的类型为 D-Infinity （DINF）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input flow direction type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _flow_direction_type_value _flow_direction_type { get; set; } = _flow_direction_type_value._MFD;

        public enum _flow_direction_type_value
        {
            /// <summary>
            /// <para>MFD</para>
            /// <para>MFD—The input flow direction raster is of type Multi Flow Direction (MFD).</para>
            /// <para>MFD—输入流向栅格的类型为多流向 （MFD）。</para>
            /// </summary>
            [Description("MFD")]
            [GPEnumValue("MFD")]
            _MFD,

        }

        /// <summary>
        /// <para>Statistics type</para>
        /// <para><xdoc>
        ///   <para>Determines the statistics type used to compute flow distance over multiple flow paths. If there is only a single flow path from each cell to a cell on the stream, all statistics types produce the same result.</para>
        ///   <bulletList>
        ///     <bullet_item>Minimum—Where multiple flow paths exist, minimum flow distance in computed. This is the default.</bullet_item><para/>
        ///     <bullet_item>Weighted Mean—Where multiple flow paths exist, a weighted mean of flow distance is computed. Flow proportion from a cell to its downstream neighboring cells are used as weights for computing weighted mean.</bullet_item><para/>
        ///     <bullet_item>Maximum—When multiple flow paths exist, maximum flow distance is computed.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定用于计算多个流路径上的流距离的统计类型。如果从每个像元到流上的像元只有一条流路径，则所有统计信息类型都会生成相同的结果。</para>
        ///   <bulletList>
        ///     <bullet_item>最小值 - 如果存在多个流路，则计算最小流程。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>加权平均值 （Weighted Mean） - 如果存在多条流路，则计算流距离的加权平均值。从像元到其下游相邻像元的流量比例用作计算加权平均值的权重。</bullet_item><para/>
        ///     <bullet_item>最大值 （Maximum） - 当存在多个流路时，将计算最大流程。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Statistics type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _statistics_type_value _statistics_type { get; set; } = _statistics_type_value._MINIMUM;

        public enum _statistics_type_value
        {
            /// <summary>
            /// <para>Minimum</para>
            /// <para>Minimum—Where multiple flow paths exist, minimum flow distance in computed. This is the default.</para>
            /// <para>最小值 - 如果存在多个流路，则计算最小流程。这是默认设置。</para>
            /// </summary>
            [Description("Minimum")]
            [GPEnumValue("MINIMUM")]
            _MINIMUM,

            /// <summary>
            /// <para>Weighted Mean</para>
            /// <para>Weighted Mean—Where multiple flow paths exist, a weighted mean of flow distance is computed. Flow proportion from a cell to its downstream neighboring cells are used as weights for computing weighted mean.</para>
            /// <para>加权平均值 （Weighted Mean） - 如果存在多条流路，则计算流距离的加权平均值。从像元到其下游相邻像元的流量比例用作计算加权平均值的权重。</para>
            /// </summary>
            [Description("Weighted Mean")]
            [GPEnumValue("WEIGHTED_MEAN")]
            _WEIGHTED_MEAN,

            /// <summary>
            /// <para>Maximum</para>
            /// <para>Maximum—When multiple flow paths exist, maximum flow distance is computed.</para>
            /// <para>最大值 （Maximum） - 当存在多个流路时，将计算最大流程。</para>
            /// </summary>
            [Description("Maximum")]
            [GPEnumValue("MAXIMUM")]
            _MAXIMUM,

        }

        public FlowDistance SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}